<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
var obj;
function floatPic(){
   	document.getElementById("style1").style.left = Math.random()*500+"px";
	document.getElementById("style1").style.top = Math.random()*500+"px";
	obj = setTimeout("floatPic()",2000);
}
 //setInterval("floatPic()",2000);
</script>
</head>

<body onload="floatPic()">
<div id="style1" style="position:absolute;">
  <a href="http://www.sina.com"><img src="images/4.jpg" /></a>
</div>
<h2>随机漂浮的广告</h2>
<a href="javascript:floatPic()">开始漂浮</a>
</body>
</html>
